//
//  SelectView.m
//  NBAPro
//
//  Created by 李广松 on 16/7/13.
//  Copyright © 2016年 WYH. All rights reserved.
//

#import "SelectView.h"

@implementation SelectView {
    UIColor *backColor;
}
@synthesize homeBtn, visitorBtn, cutLine;

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        homeBtn = [self createHomeLabelWithFrame:CGRectMake(0, 0, self.frame.size.width / 2, frame.size.height)];
        [self addSubview:homeBtn];
        
        visitorBtn = [self createVisitorButtonWithFrame:CGRectMake(self.frame.size.width / 2, 0, frame.size.width / 2, frame.size.height)];
        [self addSubview:visitorBtn];
        
        cutLine = [[UIView alloc] initWithFrame:CGRectMake(0, frame.size.height - 3, self.frame.size.width / 2, 3)];
        [self addSubview:cutLine];
        
    }
    
    return self;
}

- (UIButton *)createVisitorButtonWithFrame:(CGRect)frame {
    UIButton *button = [[UIButton alloc] initWithFrame:frame];
    button.titleLabel.font = [UIFont systemFontOfSize:14];
    [button setTitleColor:[UIColor colorWithRed:88/255.0 green:104/255.0 blue:131/255.0 alpha:1]  forState:UIControlStateNormal];
    button.backgroundColor = [UIColor colorWithRed:230/255.0 green:230/255.0 blue:230/255.0 alpha:1];
    button.titleLabel.textAlignment = NSTextAlignmentCenter;
    
    return button;
    
    return button;
}

- (UIButton *)createHomeLabelWithFrame:(CGRect)frame {
    UIButton *button = [[UIButton alloc] initWithFrame:frame];
    button.titleLabel.font = [UIFont systemFontOfSize:14];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    button.backgroundColor = [UIColor whiteColor];
    button.titleLabel.textAlignment = NSTextAlignmentCenter;
    
    return button;
}

@end
